#!/bin/bash

# SpringBoot Request Body Cache 启动脚本

echo "=================================="
echo "SpringBoot Request Body Cache 服务"
echo "=================================="
echo ""

# 设置 Java 版本（需要 Java 17+）
export JAVA_HOME=/opt/homebrew/Cellar/openjdk@21/21.0.7/libexec/openjdk.jdk/Contents/Home

# 显示 Java 版本
echo "Java 版本："
$JAVA_HOME/bin/java -version
echo ""

# 启动服务
echo "正在启动服务..."
echo "端口: 8080"
echo ""
echo "测试接口："
echo "  - http://localhost:8080/health"
echo "  - http://localhost:8080/demo"
echo "  - http://localhost:8080/multi-read"
echo ""
echo "按 Ctrl+C 停止服务"
echo "=================================="
echo ""

mvn spring-boot:run

